Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mssql] Escape all columns that do not start with "__artie" #501

Merged
merged 2 commits into from
Apr 29, 2024

Conversation

nathan-artie
Copy link
Contributor

No description provided.

@nathan-artie nathan-artie requested a review from Tang8330 April 24, 2024 20:08
@nathan-artie nathan-artie marked this pull request as ready for review April 24, 2024 20:08
@@ -25,7 +25,7 @@ func NeedsEscaping(name string, destKind constants.DestinationKind) bool {
if destKind == constants.Redshift {
reservedKeywords = constants.RedshiftReservedKeywords
} else if destKind == constants.MSSQL {
reservedKeywords = constants.MSSQLReservedKeywords
return !strings.HasPrefix(name, constants.ArtiePrefix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just escape all?

Copy link
Contributor Author

@nathan-artie nathan-artie Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to but if we escape all columns we get test errors that say artie delete flag doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing there must be some places where we escape the column names and then check if the column names contain a specific value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a guardrail in dml/merge

Copy link
Contributor

@Tang8330 Tang8330 Apr 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comparison is running "__artie_deleted" == __artie_deleted which will always equate to false

@nathan-artie nathan-artie merged commit a2f48ae into master Apr 29, 2024
1 check passed
@nathan-artie nathan-artie deleted the nv/escape-all-non-artie-columns branch April 29, 2024 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants